/*
 *  PMFunctions.h
 *  PezMonkey
 *
 *  Created by Spence DiNicolantonio on 11/3/09.
 *  Copyright 2009 Necrosoft. All rights reserved.
 *
 */

#import "PMCore.h"


/**
 * Converts a given angle from degrees to radians.
 */
static inline PMFloat PMDegreesToRadians(const PMFloat degrees) {
	return degrees * (M_PI / 180);
}

/**
 * Converts a given angle from radians to degrees.
 */
static inline PMFloat PMRadiansToDegrees(const PMFloat radians) {
	return radians * (180 / M_PI);
}

/**
 * Calculates and returns the moment of inertia for a rigid body with a given mass
 * whos polygonal shape is defined by a given set of vertices, relative to a given
 * offset from the body's center of gravity.
 */
static PMFloat PMMomentForPolygon(PMFloat mass, PMVect vertices[], PMVect offset) {
	NSUInteger vertCount = PMVectCount(vertices);
	return cpMomentForPoly(mass, vertCount, vertices, offset);
}

/**
 * Calculates and returns the moment of inertia for a rigid body with a given 
 * mass whos shape is defined by a circle with a given inner and outer radius 
 * with its center point located a given offset from the body's center of gravity.
 */
static PMFloat PMMomentForCircle(PMFloat mass, PMFloat innerRadius, PMFloat outerRadius, PMVect offset) {
	return cpMomentForCircle(mass, innerRadius, outerRadius, offset);
}
	
	
